<template>
  <UniNumberBox :value="value" :min="min" :max="max" :step="step" v-bind="getProps" @change="onChange" />
</template>

<script setup lang="ts">
  import UniNumberBox from '@/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue';
  import { propTypes } from '@/utils/propTypes';
  import { useFormItem } from '../hooks/useContext';

  const props = defineProps({
    value: propTypes.number.def(1),
    min: propTypes.number.def(0),
    max: propTypes.number.def(99999),
    step: propTypes.number.def(1),
  });

  const { getProps, setFormModel } = useFormItem(props);

  function onChange(val: number) {
    setFormModel(val)
  }
</script>

<style scoped></style>
